package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by VegetaKo on 2016/9/21.
 */
@Entity
@Table(name = "salesman_member", catalog = "")
@DynamicInsert
public class SalesmanMember extends BaseEntity {
    private String salesmanNo;
    private String salesmanName;
    private String memberNo;
    private String memberName;
    private String sta;
    private String memberWxopenid;
    private Date awardStarDatetime;
    private Date awardEndDatetime;
    private String memberWxnickname;

    @Basic
    @Column(name = "salesman_no", nullable = true, length = 64)
    public String getSalesmanNo() {
        return salesmanNo;
    }

    public void setSalesmanNo(String salesmanNo) {
        this.salesmanNo = salesmanNo;
    }

    @Basic
    @Column(name = "salesman_name", nullable = true, length = 32)
    public String getSalesmanName() {
        return salesmanName;
    }

    public void setSalesmanName(String salesmanName) {
        this.salesmanName = salesmanName;
    }

    @Basic
    @Column(name = "member_no", nullable = true, length = 32)
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    @Basic
    @Column(name = "member_name", nullable = true, length = 32)
    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    @Basic
    @Column(name = "sta", nullable = true, length = 32)
    public String getSta() {
        return sta;
    }

    public void setSta(String sta) {
        this.sta = sta;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SalesmanMember that = (SalesmanMember) o;

        if (salesmanNo != null ? !salesmanNo.equals(that.salesmanNo) : that.salesmanNo != null) return false;
        if (salesmanName != null ? !salesmanName.equals(that.salesmanName) : that.salesmanName != null) return false;
        if (memberNo != null ? !memberNo.equals(that.memberNo) : that.memberNo != null) return false;
        if (memberName != null ? !memberName.equals(that.memberName) : that.memberName != null) return false;
        if (sta != null ? !sta.equals(that.sta) : that.sta != null) return false;
        if (awardStarDatetime != null ? !awardStarDatetime.equals(that.awardStarDatetime) : that.awardStarDatetime != null) return false;
        if (awardEndDatetime != null ? !awardEndDatetime.equals(that.awardEndDatetime) : that.awardEndDatetime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = salesmanNo != null ? salesmanNo.hashCode() : 0;
        result = 31 * result + (salesmanName != null ? salesmanName.hashCode() : 0);
        result = 31 * result + (memberNo != null ? memberNo.hashCode() : 0);
        result = 31 * result + (memberName != null ? memberName.hashCode() : 0);
        result = 31 * result + (sta != null ? sta.hashCode() : 0);
        result = 31 * result + (awardStarDatetime != null ? awardStarDatetime.hashCode() : 0);
        result = 31 * result + (awardEndDatetime != null ? awardEndDatetime.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "member_wxopenid", nullable = true, length = 64)
    public String getMemberWxopenid() {
        return memberWxopenid;
    }

    public void setMemberWxopenid(String memberWxopenid) {
        this.memberWxopenid = memberWxopenid;
    }

    @Basic
    @Column(name = "award_star_datetime", nullable = true)
    public Date getAwardStarDatetime() {
        return awardStarDatetime;
    }

    public void setAwardStarDatetime(Date awardStarDatetime) {
        this.awardStarDatetime = awardStarDatetime;
    }

    @Basic
    @Column(name = "award_end_datetime", nullable = true)
    public Date getAwardEndDatetime() {
        return awardEndDatetime;
    }

    public void setAwardEndDatetime(Date awardEndDatetime) {
        this.awardEndDatetime = awardEndDatetime;
    }

    @Basic
    @Column(name = "member_wxnickname", nullable = true, length = 64)
    public String getMemberWxnickname() {
        return memberWxnickname;
    }

    public void setMemberWxnickname(String memberWxnickname) {
        this.memberWxnickname = memberWxnickname;
    }

    public enum SalesmanMember_{
        salesmanNo,salesmanName,memberNo,memberName,sta,awardStarDatetime,awardEndDatetime,memberWxopenid
    }
}
